package com.atcumt.meituan;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main01 {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        if (s.matches("([A-Z][a-z]*,)*([A-Z][a-z]*)")) {
            System.out.println("error.0001");
        } else {
            String[] ss = s.split(",");
            Map<String, Integer> map = new HashMap<>();
            int rote = 1;
            for (String str : ss) {
                map.put(str, map.getOrDefault(str, 0) + 1);
                rote = Math.max(rote, map.get(str));
            }
            List<String> list = new ArrayList<>();
            for (String str : map.keySet()) {
                if (map.get(str) == rote) {
                    list.add(str);
                }
            }
            list.sort((s1, s2) -> s1.compareTo(s2));
            System.out.println(list.get(0));
        }
    }
}
